/**
 * @Title:PermissionController.java
 * @Package:com.xpjhs.permission.web.controller
 * @Description:TODO
 * @author:luckyboyguo@126.com
 * @date:2015年1月16日{time}
 * @version:v1.0
 */
package com.xpjhs.permission.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.xpjhs.permission.model.Permission;
import com.xpjhs.permission.service.PermissionService;

/**
 * @ClassName:PermissionController
 * @Description:{todo
 * @author luckyboyguo@126.com
 * @date:2015年1月16日下午1:41:06
 */
@Controller
@RequestMapping("/permission")
public class PermissionController {
	
	@Autowired
	private PermissionService permissionService;

	@RequestMapping("/savePermission")
	public  String savePermission(HttpServletRequest request, ModelMap model) {
		Permission permission = new Permission();
		permission.setPermission("添加");
		permissionService.savePermission(permission);
		System.out.println("权限保存成功 ");
		return null;
	}
	
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public String permissionList(HttpServletRequest request,ModelMap model){
		
		return "permission.list";
	}
}
